<?php
/**
 * Created by PhpStorm.
 * User: zhangrxiang
 * Date: 2016/12/15
 * Time: 10:42
 */


//Binary safe string comparison of the first n characters

//function strncmp ($str1, $str2, $len) {}

//如果 str1 小于 str2 返回 < 0； 如果 str1 大于 str2 返回 > 0；如果两者相等，返回 0。

echo strncmp("ac","qx",1).PHP_EOL; // 0
echo strncmp("xybc","a3234",2).PHP_EOL; //
echo strncmp("blah123","hohoho", 2).PHP_EOL; //
echo strncmp("test","@", 1).PHP_EOL; //
echo strncmp("@test","@", 1).PHP_EOL; //